#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.68])
AC_INIT(mBuild, 1.1, Yi.He.Ustcer@gmail.com)
LT_INIT()
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_AWK
AC_LANG_CPLUSPLUS
AC_LANG_C
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB

AM_PROG_CC_C_O
# check for tcl
SC_PATH_TCLCONFIG
SC_LOAD_TCLCONFIG
SC_PROG_TCLSH
if test x"$TCLSH_PROG" -eq x"" ; then
  mytclsh="/usr/bin/env tclsh"
else 
  mytclsh="$TCLSH_PROG"
fi
SC_CONFIG_SYSTEM

# Checks for libraries.

# Checks for header files.
AC_CHECK_HEADERS([string.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE

# Options
AM_PROG_LIBTOOL
AM_DISABLE_SHARED
#doxygen
#DX_HTML_FEATURE(ON)
#DX_CHM_FEATURE(OFF)
#DX_CHI_FEATURE(OFF)
#DX_MAN_FEATURE(ON)
#DX_RTF_FEATURE(OFF)
#DX_XML_FEATURE(OFF)
#DX_PDF_FEATURE(ON)
#DX_PS_FEATURE(OFF)
#DX_INIT_DOXYGEN(mBuild, doxygen.cfg)
AM_INIT_AUTOMAKE()

# Checks for library functions.
AC_CHECK_FUNCS([floor pow sqrt strchr])
AC_CONFIG_FILES([Makefile
                 src/Makefile
                 src/UnitTests/Makefile
                 src/apps/Makefile
                 src/essential/Makefile
                 src/include/Makefile
                 tools/CHARMM_patch/Makefile
                 tools/GUI/Makefile
                 tools/Makefile
                 tools/NAMD_Geo_Constraint/Makefile
                 tools/batch_build/Makefile
                 tools/pqr_converter/Makefile])
AC_SUBST(mytcl)
AC_SUBST(TCL_LIB_SPEC)
AC_SUBST(TCL_INCLUDE_SPEC)
AC_OUTPUT
echo \
"-------------------------------------------------

 ${PACKAGE_NAME} Version ${PACKAGE_VERSION}

 Prefix: '${prefix}'.
 Compiler: '${CC} ${CFLAGS} ${CPPFLAGS}'
 Use tclsh include: ${TCL_INCLUDE_SPEC}
 Use tclsh: ${mytclsh}

 Now type 'make @<:@<target>@:>@'
   where the optional <target> is:
     all                - build all binaries
     check              - test the package
     install            - install everything

--------------------------------------------------"
